From: Aaron Schulz Date: Tue, 21 Apr 2009 06:21:27 +0000 (+0000) Subject: * Workaround ugly Safari/Chrome handling of tags for hidden diffs (bug 18538) X-Git-Tag: 1.31.0-rc.0~42084 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=318783dc363ac291fe5af4a109c8a1adba46d8f3;p=lhc%2Fweb%2Fwiklou.git * Workaround ugly Safari/Chrome handling of tags for hidden diffs (bug 18538) * A few code style tweaks --- diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 278853674f..d3f59acc34 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -43,7 +43,9 @@ class DifferenceEngine { * @param $htmldiff boolean If set, output using HTMLDiff instead of raw wikicode diff * @param $unhide boolean If set, allow viewing deleted revs */ - function __construct( $titleObj = null, $old = 0, $new = 0, $rcid = 0, $refreshCache = false , $htmldiff = false, $unhide = false ) { + function __construct( $titleObj = null, $old = 0, $new = 0, $rcid = 0, + $refreshCache = false, $htmldiff = false, $unhide = false ) + { $this->mTitle = $titleObj; wfDebug("DifferenceEngine old '$old' new '$new' rcid '$rcid'\n"); @@ -192,12 +194,12 @@ CONTROL; $db = wfGetDB( DB_SLAVE ); $change = RecentChange::newFromConds( array( - // Add redundant user,timestamp condition so we can use the existing index - 'rc_user_text' => $this->mNewRev->getRawUserText(), - 'rc_timestamp' => $db->timestamp( $this->mNewRev->getTimestamp() ), - 'rc_this_oldid' => $this->mNewid, - 'rc_last_oldid' => $this->mOldid, - 'rc_patrolled' => 0 + // Redundant user,timestamp condition so we can use the existing index + 'rc_user_text' => $this->mNewRev->getRawUserText(), + 'rc_timestamp' => $db->timestamp( $this->mNewRev->getTimestamp() ), + 'rc_this_oldid' => $this->mNewid, + 'rc_last_oldid' => $this->mOldid, + 'rc_patrolled' => 0 ), __METHOD__ ); @@ -755,17 +757,21 @@ CONTROL; * Add the header to a diff body */ static function addHeader( $diff, $otitle, $ntitle, $multi = '' ) { - $header = " - - - - - + $colspan = 1; + $header = "
"; + if( $diff ) { // Safari/Chrome show broken output if cols not used + $header .= " + + + + "; + $colspan = 2; + } + $header .= " - - - - "; + + + "; if ( $multi != '' ) $header .= ""; @@ -825,7 +831,6 @@ CONTROL; $this->mNewtitle = "{$this->mPagetitle}"; $this->mNewtitle .= " (" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . ")"; - } else { $newLink = $this->mNewPage->escapeLocalUrl( 'oldid=' . $this->mNewid ); $newEdit = $this->mNewPage->escapeLocalUrl( 'action=edit&oldid=' . $this->mNewid ); @@ -834,10 +839,10 @@ CONTROL; $this->mNewtitle = "{$this->mPagetitle}"; $this->mNewtitle .= " (" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . ")"; } - if ( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { + if( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { $this->mNewtitle = "{$this->mPagetitle}"; } else if ( $this->mNewRev->isDeleted(Revision::DELETED_TEXT) ) { - $this->mNewtitle = ''.$this->mNewtitle.''; + $this->mNewtitle = "{$this->mNewtitle}"; } // Load the old revision object
{$otitle}{$ntitle}
{$otitle}{$ntitle}
{$multi}